package application;

import java.util.ArrayList;
import java.lang.Character;

public class intStack {

    ArrayList<Integer> a;
    int currentItem;

    public intStack() {
        a = new ArrayList();
        currentItem = 0;
    }

    public void push(int i) {
        a.add(Integer.valueOf(i));
        currentItem++;
    }

    public int pop() {
        int result = a.get(--currentItem);
        a.remove(currentItem);
        return result;
    }

    public String showStack() {
        return a.toString();
    }

    public boolean isEmpty() {
        if (currentItem == 0) {
            return false;
        }
        return true;
    }

    public int getCurrentItem() {
        return currentItem;
    }

    public int size() {
        return currentItem;
    }

    public int getlast() {
        return a.get(currentItem - 1);
    }
}
